package com.hs.mapper;

import com.hs.entity.TbUser;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface TbUserMapper {

    /*默认*/

    int deleteByPrimaryKey(Integer id);

    int insert(TbUser record);

    int insertSelective(TbUser record);

    TbUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbUser record);

    int updateByPrimaryKey(TbUser record);

    /*登录*/

    List<TbUser> findUserListByRoleId(Integer roleId);

    TbUser selectByUsername(String account);

    /*修改密码*/

    TbUser queryForForgetPassword(@Param("account") String account,@Param("realname") String realname,@Param("email") String email,@Param("roleid") String roleid,@Param("gender") Integer gender);

    int changeForForgetPassword(@Param("password") String password,@Param("id") Integer id);

    List<TbUser> findUserList();

    int insertUser();

    /*用户*/
    Integer createAccount(@Param("realName") String realName,@Param("password") String password,@Param("number") String number,@Param("account") String account,@Param("roleId") Integer roleId);

    TbUser queryById(@Param("id") Integer id);

    Integer updateUserForStudent(@Param("map") Map<String, String[]> map);

    Integer updatePasswordById(@Param("md5") String md5, @Param("id") Integer id);

    Integer countUser(String roleId);
}